<{include file="public_html/header.html"}>
<{include file="public_html/left_menu.html"}>
	<!-- content starts -->
	<blockquote class="layui-elem-quote"><{$action}></blockquote>

	<fieldset class="layui-elem-field">
  		<legend>按条件搜索</legend>
  		<div class="layui-field-box">
			<form class="layui-form layui-form-pane1" method="post" action="">
				<{assign var="pid" value=$conditions['pid']|default:"all"}>
				<div class="layui-form-item">
					
					<div class="layui-inline">
			    		<input type="text" name="start_time" id="start_time" lay-verify="required|date" placeholder="开始时间" autocomplete="off" class="layui-input" value="<{if !empty($conditions.start_time)}><{$conditions.start_time|date_format:'%Y-%m-%d'}><{/if}>" >
			    	</div>

			    	<div class="layui-inline">
			    		<input type="text" name="end_time" id="end_time" lay-verify="required|date" placeholder="结束时间" autocomplete="off" class="layui-input" value="<{if !empty($conditions.end_time)}><{$conditions.end_time|date_format:'%Y-%m-%d'}><{/if}>"  >
			    	</div>
			    	
			    	<div class="layui-inline">
			    		<button type="submit" class="layui-btn">搜索</button>
			    	</div>
		    	</div>
			</form>
  		</div>
	</fieldset>
	<form class="layui-form layui-form-pane1" method="post" action="/user/update_sorts" delete_action="/user/delete">
		<table class="layui-table" lay-even lay-skin="row">
		  	<thead>
			  	<tr>
				  	<th>用户ID</th>
				  	<th>昵称</th>
				  	<th>第一次请求时间</th>
				  	<th>最后一次请求时间</th>
				  	<th>请求量</th>
					<th>操作</th>
			  	</tr>
		  	</thead>   
		  	<tbody>
		  	<{foreach from=$visit_statistics_info item=item}>
		  	<tr>

		  		<td class="center"><{$item['user_id']}><{if $item.is_new_user == 1}><span style="color:red;">[新]</span><{/if}></td>
		  		<td class="center"><img src="<{$item['head_img_url']}>" style="width: 40px;"> <{$item['nick']}></td>
				<td class="center"><{$item['first_time']|date_format:'%Y-%m-%d %H:%M:%S'}></td>
				<td class="center"><{$item['last_time']|date_format:'%Y-%m-%d %H:%M:%S'}></td>
				<td class="center"><{$item['count']}></td>
		  		<td class="center"><a class="layui-btn" href="/user/visit_statistics/<{$item['user_id']}>/<{$conditions.start_time|date_format:'%Y-%m-%d'}>/<{$conditions.end_time|date_format:'%Y-%m-%d'}>">查看用户轨迹</a></td>
		  	</tr>
	  	<{/foreach}>
		  	<{if $visit_statistics_info|count eq 0}>
		  		<tr>
			  		<td class="center" style=" height:120px; text-align:center;line-height:120px;" colspan="8">
						赞无数据！
					</td>
			  	</tr>
		  	<{/if}>
		  	<!-- 	<tr>
				<td class="center" colspan="7">
					<input type="checkbox" lay-filter="checkbox_all" title="全选">
					<button id="delete" class="layui-btn layui-btn-primary layui-btn-small" style="margin-top:4px;"><i class="layui-icon"></i> 批量删除</button>
				</td>
			</tr> -->
	  		</tbody>
	  	</table>
  	</form>
  	<div class="layui-box layui-laypage layui-laypage-default">
		<{$pagination}>
	</div>
<{include file="public_html/footer.html"}>
<script>
    layui.use(['laydate', 'form'], function(){
        var laydate = layui.laydate, form = layui.form();

        var start = {
            max: laydate.now()
            ,istoday: false
            ,format: 'YYYY-MM-DD'
            ,choose: function(datas){
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
            }
        };
      
        var end = {
            max: laydate.now()
            ,istoday: false
            ,format: 'YYYY-MM-DD'
            ,choose: function(datas){
            start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
      
        document.getElementById('start_time').onclick = function(){
            start.elem = this;
            laydate(start);
        }
        document.getElementById('end_time').onclick = function(){
            end.elem = this
            laydate(end);
        }
    });
</script>